home *** CD-ROM | disk | FTP | other *** search
- Path: cse.unl.edu!chijang
- From: chijang@cse.unl.edu (Chi-Jang Huang)
- Newsgroups: comp.lang.c++
- Subject: What does this "const" mean?
- Date: 28 Feb 1996 03:47:10 GMT
- Organization: University of Nebraska--Lincoln
- Message-ID: <4h0j7u$htp@crcnis3.unl.edu>
- NNTP-Posting-Host: cse.unl.edu
- Keywords: const
-
-
- Hi,
-
- I have some problems regarding this program segment:
-
- class intset {
- // ...
- void start(int& i) const { i = 0; }
- int ok(int& i) const { return i<cursize; }
- int next(int& i) const { return x[i++]; }
- };
-
- What does "const" mean in this program segment? What role does
- it play? In what kind of situation will we use "const" like this?
- Any comments or suggestions are highly appreciated. Thanks.
-
- --Chijang Huang.
- ===========================
- chijang@cse.unl.edu
-